package Chapter02.Homework.H20211110;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Scanner;

public class Work05 {
    public static void main(String[] args) {
        Scanner input=new Scanner(System.in);
        System.out.println("请输入年份：");
        Calendar c=Calendar.getInstance();
        c.set(input.nextInt(),5,1);
        for (int i=0;;){
            if(c.get(Calendar.DAY_OF_WEEK)==1){
                i++;
            }
            if(i==3){
                System.out.println("父亲节："+new SimpleDateFormat("dd日").format(c.getTime()));
                break;
            }
            c.add(Calendar.DATE,1);
        }
    }
}
